#include "CRS.h"

T* Mul(CRSMatrix Matrix, T* vector)
{
    T* res=new T[Matrix.numRow];
    for(unsigned int i=0; i<Matrix.numRow; i++)
    {
        T tmp=0;
        for(unsigned int j=Matrix.pointerB[i]; j<Matrix.pointerB[i+1]; j++)
        {
            tmp+=(Matrix.val[j]*vector[Matrix.column[j]]);
        }
        res[i]=tmp;
    }
    return res;
}